import request from '@/utils/request'


// 验证码登录
export function verifyCode(phone, code, username, password) {
  return request({
    url: `/verify_code?account=${phone}&code=${code}&username=${username}&password=${password}`,
    method: 'post',
    data: {},
    // params
    // headers: {
    //   "Content-Type": "text/plain"
    // }
  })
}

// 登录
export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data,
    headers: {
      "Content-Type": "text/plain"
    }
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}




export function initvalue() {
  return request({
    url: '/production_product?product=b0ddc0b387',
    method: 'get'
  })
}

export function initlist(product) {
  return request({
    url: '/amis/Device?where={"product": "' + product + '"}',
    method: 'get'
  })
}

export function submit(data) {
  return request({
    url: '/production_product',
    method: 'post',
    data
  })
}

export function getData(id, production, time, time1) {
  return request({
    // url: '/device/'+id+'?where={"production":"'+production+'","time":{"$gte":'+time+'},"time":{"$lte":'+time1+'}}&limit=30&order=-createdAt',
    url: '/device/' + id +
      // '?where={"production":"' + production + '","time":{"$gte":' + time + '},"time":{"$lte":' + time1 + '}}'
      +
      '&limit=30&order=-createdAt',
    // url: '/device/'+id,
    method: 'get',
  })
}

import {
  currentList,
  currentPage,
  currentSave,
  currentUpdate,
  currentDelete,
  currentSelect,
  currentSelectList,

  currentPOST,
  currentGET,
  currentApi

} from './modules'
import {
  GETNOBASE,
  GET
} from './api'


export {
  GETNOBASE,
  GET
}


export {
  currentApi,
  currentList,
  currentPage,
  currentSave,
  currentUpdate,
  currentDelete,
  currentSelect,
  currentSelectList,
  currentPOST,
  currentGET
}
